Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow only the first group in symbols sections when using RMLVO #518

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

wismill
Copy link
Member

@wismill wismill commented Sep 30, 2024

Currently xkb_keymap_num_layouts may return a greater number than the number of layouts configured using RMLVO, because we allow symbols sections to define various groups per key.

This is unintuitive and kind of buggy: groups should be added via rules by setting an explicit :n modifier.

Fix: when parsing a keymap using RMLVO resolution:

  • Get the expected layouts count from the resulting KcCGST.
  • Drop the groups after the first one in included symbols sections. This will ensure that a symbol section can only define one group per key.

Notes:

  • Compiling a keymap string directly is unaffected.
  • RMLVO resolution may still produce more groups than the input layouts. Indeed, some legacy rules in xkeyboard-config rely on this to insert automatically a US layout before to the given non-Latin one, resulting in two layouts while only one was given.

Fixes #262

@wismill wismill added compile-keymap Indicates a need for improvements or additions to keymap compilation rules labels Sep 30, 2024
@wismill wismill added this to the 1.8.0 milestone Sep 30, 2024
@wismill wismill force-pushed the groups/disallow-extra-key-groups branch from be14945 to 8bb26a1 Compare October 2, 2024 06:59
Currently `xkb_keymap_num_layouts` may return a greater number than the
number of layouts configured using RMLVO, because we allow symbols
sections to define various groups per key.

This is unintuitive and kind of buggy: groups should be added via rules
by setting an explicit `:n` modifier.

Fix: when parsing a keymap using RMLVO resolution:
- Get the expected layouts count from the resulting KcCGST.
- Drop the groups after the first one in included symbols sections. This
  will ensure that a symbol section can only define one group per key.

Notes:
- Compiling a keymap string directly is unaffected.
- RMLVO resolution may still produce more groups than the input layouts.
  Indeed, some legacy rules in xkeyboard-config rely on this to insert
  automatically a US layout before the given non-Latin one, resulting
  in two layouts while only one was given.
@wismill wismill force-pushed the groups/disallow-extra-key-groups branch from 8bb26a1 to 27a951a Compare October 11, 2024 14:15
@wismill wismill merged commit 7c4c718 into xkbcommon:master Oct 11, 2024
4 checks passed
@wismill wismill deleted the groups/disallow-extra-key-groups branch October 11, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong layouts number returned with lv3:ralt_alt option
1 participant